/**********************************************************
 *
 *  Copyright (c) 2003  SeikoEpson Inc
 *  All Rights Reserved
 *
 *  File name : f_smcvals.c
 *  Function  :
 *        f_smcvals.c sets the some special codes, such as f_NaN, Inf
 *        and -Inf, also sets the useful nubmer.
 *        This file is copied from math.lib of 
 *                  CC33 tool(CC33v40.exe + CCPA45.exe, 
 *                  math of ansilib33v25 )
 *
 *  original file's Revision  :
 *      1993/08/31    first release                 K.Shinozuka
 *      1993/12/17    change file name              K.Shinozuka
 *      1997/03/27    change to const               M.Kudo
 *  Revision  :
 *      2003/ 3/18    IrumaSoft M.Takeishi   1.st design
 *
 **********************************************************/



#ifdef UNIX
struct f_native {                         /* A certain c compiler doesn't allow the */
        unsigned long _LL;                /* initializeing a union. I used this structure */
};                                        /* to initialize DBL_LNG NAN, P_INF, N_INF */



//#ifdef BIG_ENDIAN
const struct f_native f_NAN = { 0x7fc00000 };    /* special code for not a number ( NaN ) */
const struct f_native f_P_INF = { 0x7f800000 };  /* special code for +overflow ( +Inf ) */
const struct f_native f_N_INF = { 0xff800000 };  /* special code for -overflow ( -Inf ) */
//#else
//const struct native f_NAN = { 0x7fc00000 };
//const struct native f_P_INF = { 0x7f800000 };
//const struct native f_N_INF = { 0xff800000 };
//#endif

#else
#ifndef F_DBL_LNG_TYPE 
#define F_DBL_LNG_TYPE 

typedef union {
    struct {
#ifdef BIG_ENDIAN
        unsigned long _LL;
//        unsigned long _LH;
#else
//        unsigned long _LH;
        unsigned long _LL;
#endif
    } st;
    float _F;
} FLT_LNG;
#endif                                  /* endif FLT_LNG_TYPE */

#ifdef BIG_ENDIAN
const FLT_LNG f_NAN = { 0x7fc00000 };         /* special code for not a number ( NaN ) */
const FLT_LNG f_P_INF = { 0x7f800000 };      /* special code for +overflow ( +Inf ) */
const FLT_LNG f_N_INF = { 0xff800000 };      /* special code for -overflow ( -Inf ) */
#else
const FLT_LNG f_NAN = { 0x7fc00000 };
const FLT_LNG f_P_INF = { 0x7f800000 };
const FLT_LNG f_N_INF = { 0xff800000 };
#endif

#endif                                  /* endif UNIX */

const float f_HUGE_RAD = 3.14e9;
